#ifndef CLIENT_H
#define CLIENT_H

#include <QMainWindow>
#include <QNetworkInterface>//网络信息
#include <QHostAddress>//id地址
#include <QTcpServer> //tcp协议
#include <QTcpSocket> //socket套接字

QT_BEGIN_NAMESPACE
namespace Ui { class client; }
QT_END_NAMESPACE

class client : public QMainWindow
{
    Q_OBJECT

public:
    client(QWidget *parent = nullptr);
    ~client();
    QTcpSocket *ksocket;

    void send_foodmsg(QString food);

private slots:
    void on_send_pushButton_clicked();

    void readmessage();

    void connectToServer();

    void tryConnect(QTcpSocket* ksocket);

private:
    Ui::client *ui;
};
#endif // CLIENT_H
